﻿function cucancel()
{
 var refer = document.referrer.toLowerCase();
    if(refer=="")
    {
        top.location = "/Course/";
    }    
    else
    {
        window.location.href = refer;
    }
}
function savelesson()
{    
    showProgressBar(true);
    $("ErrorDesc").style.display = "none";
     var valDesc = "";//内容    
    try{valDesc=FCKeditorAPI.GetInstance('txtDesc').GetXHTML(true);}catch(e){} 

    if(!$ValidButton$()||valDesc.length<3 || valDesc.length>9999)
    {
        if(valDesc.length<3 || valDesc.length>9999)
        {
            $("ErrorDesc").style.display = "";
        }        
        showProgressBar(false);
        return;
    }
    $get("btSave").disabled = true;
     WebServices.User.Teach.AddLesson(cid,$('LessonText').value,valDesc,$('LongTime').value,onsucc);    
}
function onsucc(result)
{
    $get("btSave").disabled = false;
    showProgressBar(false);
    if(result==-1)
        alert('ssss');
    else
        top.location="/lesson/"+result;
}